import request from '@/api/utils/request';
import requestRouter from '@/api/utils/requestRouter';
let url = '/documentCirculation';

// 查看详情
export const getDetail = data =>
  request({
    url: url + '/task/getProcessInfo/' + data,
    method: 'post'
  });
// 催办
export function hurryHandle(data) {
  return request({
    url: url + '/task/hurryHandle',
    method: 'post',
    data: data
  });
}
// 撤销
export function revokeTask(data) {
  return request({
    url: url + '/task/revokeTask',
    method: 'post',
    data: data
  });
}
// 获取华为云密钥
export const getAccessGet = params =>
  request({
    url: `/file/obs/accessGet`,
    method: 'post',
    params
  });
// 表单提交/通过
export const completeTask = data =>
  request({
    url: url + '/task/completeTask',
    method: 'post',
    data
  });
//   拒绝
export const deleteTask = data =>
  request({
    url: url + '/task/deleteTask',
    method: 'post',
    data
  });
// 转办
export const transferTask = data =>
  request({
    url: url + '/task/transferTask',
    method: 'post',
    data
  });
//  2.0.2 新增  获取关联校区部门架构
export const getDeptTree = () =>
  request({
    url: '/zhxy-user-data/common/getRelationSchoolDeptTree',
    method: 'get'
  });
//  2.0.2 新增   获取关联校区角色结构
export const getRelationSchoolRoleStruct = () =>
  request({
    url: '/zhxy-user-data/common/getRelationSchoolRoleStruct',
    method: 'get'
  });
//  2.0.2 新增  获取常用联系人
export const getFrequentContacts = () =>
  request({
    url: '/zhxy-user-data/selectUserContacts/getFrequentContacts',
    method: 'get'
  });
// 保存常用联系人
export const saveFrequentContacts = data =>
  request({
    url: '/zhxy-user-data/selectUserContacts/saveFrequentContacts',
    method: 'post',
    data
  });
// 公文提交
export const runtimeTask = data =>
  request({
    url: url + '/task/runtimeTask',
    method: 'post',
    data
  });
//  催办人list
export const getCurrentApproveUserList = id =>
  request({
    url: url + '/task/getCurrentApproveUserList/' + id,
    method: 'get'
  });
// 废弃
export const abandon = data =>
  request({
    url: url + '/documentCirculation/abandon',
    method: 'post',
    data
  });
export const insertList = params =>
  request({
    url: url + '/documentLabelCorrelation/insertList',
    method: 'get',
    params
  });
export const updateDocumentHandler = data =>
  request({
    url: url + '/task/updateDocumentHandler',
    method: 'post',
    data
  });
// 用户校验
export const userValidate = data =>
  request({
    url: url + '/documentCirculation/userValidate',
    method: 'post',
    data
  });
// 下载pdf
export const PdfConversion = data =>
  request({
    url: '/nodepdf/pdf/PdfConversion',
    method: 'post',
    data
  });
// 查看详情
export const getDetails = data =>
  requestRouter({
    url: url + '/task/getProcessInfo/' + data,
    method: 'post'
  });
